//
//  LocationQuickMatingCell.m
//  BigToBig
//
//  Created by yi liu on 16/7/27.
//  Copyright © 2016年 cn.cloudtp. All rights reserved.
//

#import "LocationQuickMatingCell.h"

@implementation LocationQuickMatingCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubViews];
    }
    return self;
}


- (void)createSubViews{
    //  头像
    self.headImageView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 10, (kScreenWidth - 20)/6, (kScreenWidth - 20)/6)];
    self.headImageView.center = CGPointMake(self.headImageView.width / 2 + 10, 50);
    self.headImageView.image = [UIImage imageNamed:@"touxiang"];
    [self addSubview:self.headImageView];
    self.headImageView.layer.cornerRadius = (kScreenWidth - 20)/12;
    self.headImageView.layer.masksToBounds = YES;
    
    // 标题
    self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.headImageView.maxX + 10, self.headImageView.y, kScreenWidth/2 - self.headImageView.maxX - 10, self.headImageView.height /3)];
    self.titleLabel.text = @"创业生态园";
    [self addSubview:self.titleLabel];
    self.titleLabel.textAlignment = NSTextAlignmentLeft;
    
    // 日期
    self.timeLabel = [[UILabel alloc]initWithFrame:CGRectMake(kScreenWidth / 2, self.titleLabel.y, kScreenWidth - self.titleLabel.maxX - 10, self.titleLabel.height)];
    self.timeLabel.textAlignment = NSTextAlignmentRight;
    [self addSubview:self.timeLabel];
    self.timeLabel.font = [UIFont systemFontOfSize:13];
    _timeLabel.textColor = [UIColor lightGrayColor];
    
    
    // 分类
    self.groupLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.titleLabel.x, self.titleLabel.maxY + 5, self.headImageView.width, self.titleLabel.height)];
    _groupLabel.backgroundColor = COLOR_RGBA(0, 228, 161, 1);
    [self addSubview:self.groupLabel];
    self.groupLabel.font = [UIFont systemFontOfSize:12];
    _groupLabel.textAlignment = 1;
    self.groupLabel.textColor = [UIColor lightGrayColor];
    _groupLabel.textColor = [UIColor whiteColor];
    _groupLabel.layer.cornerRadius = 5;
    _groupLabel.layer.masksToBounds = YES;

    
    
    // 已融资图标
    UIImageView *financeImageView = [[UIImageView alloc]initWithFrame:CGRectMake(self.titleLabel.x, self.groupLabel.maxY + 5, self.headImageView.width / 7 * 2 + 1, self.headImageView.width / 7 * 2 + 1)];
    financeImageView.image = [UIImage imageNamed:@"finance"];
    [self addSubview:financeImageView];
    
    // 已关注人数
    self.financeLabel = [[UILabel alloc]initWithFrame:CGRectMake(financeImageView.maxX, financeImageView.y, kScreenWidth / 9 * 2 , financeImageView.height)];
    self.financeLabel.text = [NSString stringWithFormat:@" 已融资20万"];
    self.financeLabel.font = [UIFont systemFontOfSize:12];
    self.financeLabel.textColor = [UIColor lightGrayColor];
    [self addSubview:self.financeLabel];
    
    // 已查看图标
    UIImageView *projectImageView = [[UIImageView alloc]initWithFrame:CGRectMake(self.financeLabel.maxX, self.financeLabel.y, financeImageView.width , financeImageView.height)];
    projectImageView.image = [UIImage imageNamed:@"project"];
    [self addSubview:projectImageView];
    
    // 已查看人数
    self.projectLabel = [[UILabel alloc]initWithFrame:CGRectMake(projectImageView.maxX, projectImageView.y, self.financeLabel.width , self.financeLabel.height)];
    self.projectLabel.text = [NSString stringWithFormat:@" 投资0个项目"];
    self.projectLabel.font = [UIFont systemFontOfSize:12];
    self.projectLabel.textColor = [UIColor lightGrayColor];
    [self addSubview:self.projectLabel];
    // 底层分割线
    UILabel *bottomLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 99, kScreenWidth, 1)];
    bottomLabel.backgroundColor = COLOR_RGBA(247, 247, 247, 1);
    [self addSubview:bottomLabel];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
